package com.jukte.recipe;

import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.annotation.TargetApi;
import android.content.Intent;
import android.view.View;
import android.webkit.WebView;
import com.ewhat.recipes.R;

public class HowToCookQuinoaActivity extends BaseActivity {
	private WebView lWebView ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_how_to_cook_quinoa);  
		init();

		lWebView= (WebView)findViewById(R.id.webview);
		 if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
	            // only for gingerbread and newer versions
	        	setLayerTypeToWebview();
	        }
         lWebView.setBackgroundColor(0x00000000);
         lWebView.loadUrl("file:///android_res/raw/how_to_cook_quinoa.html");
//         lWebView.loadUrl("file:///"+getFilesDir().getPath()+"/raw/"+"how_to_cook_quinoa.html");
	}

	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	private void setLayerTypeToWebview() {
		// TODO Auto-generated method stub
		lWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
	}
	
	@Override
	public void init() {
		// TODO Auto-generated method stub
		super.init();
		tv_title.setText("How to cook Quinoa");
	}

	public void onAdClick(View v){
		Uri uri = Uri.parse("http://d4f6fiheeb24fsf8diuscyfw7k.hop.clickbank.net/?tid=APP");
		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
		startActivity(intent);
	}
}
